//
// Copyright (c) 2010 xiaoningyb (xiaoningyb@gmail.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef TINYSHARING_REQUEST_HANDLER_H
#define TINYSHARING_REQUEST_HANDLER_H

#include <string>
#include <boost/noncopyable.hpp>

namespace tinysharing
{
    struct sharing_message;

    /// The common handler for all incoming requests.
    class request_handler
        : private boost::noncopyable
    {
    public:
        /// Construct with a directory containing files to be served.
        explicit request_handler();

        /// Handle a request and produce a reply.
        void handle_request(const sharing_message& req, sharing_message& rep);

    private:
        /// The directory containing the files to be served.
        std::string doc_root_;
    };

} // namespace tinysharing


#endif // FILESHARING_REQUEST_HANDLER_H
